package top.korori.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.korori.entity.SysRoleMenu;
import top.korori.mapper.SysRoleMenuMapper;
import top.korori.service.SysRoleMenuService;

import java.util.List;

/**
 * 
 * 菜单角色关联 服务实现类
 * 
 *
 * @author korori
 * @since
 */
@Service
public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRoleMenu> implements SysRoleMenuService {

    @Override
    public void delByMenuIds(List<Long> menuIds) {
        LambdaQueryWrapper<SysRoleMenu> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(SysRoleMenu::getMenuId,menuIds);
        this.remove(queryWrapper);
    }

    @Override
    public void delByRoleId(Long roleId) {
        LambdaQueryWrapper<SysRoleMenu> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SysRoleMenu::getRoleId,roleId);
        this.remove(queryWrapper);
    }
}
